#include <iostream>
#include <algorithm>
using namespace std;

signed main()
{
    int f[1000] = {0},No = 0;
    string s1,s2;
    cin>>s1>>s2;
    for(int i=0;i<s1.size();i++)    f[s1[i]]++;
    for(int i=0;i<s2.size();i++){
        if(f[s2[i]])    f[s2[i]]--;
        else    No++;
    }
    if(No)    cout<<"No "<<No<<"\n";
    else    cout<<"Yes "<<s1.size()-s2.size()<<"\n";
    return 0;
}
